<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>{$resone.title} - 莫宁</title>
		<meta name="keywords" content="{$resone.title}"/>
		<meta name="description" content="欢迎前来莫宁实力旺铺，选购{$resone.title}实力旺铺，更多商品任你选购"/>
<link rel="stylesheet" href="__PUBLIC__/Mobile/css/bootstrap.css"/>
	<link rel="stylesheet" href="__PUBLIC__/Mobile/css/zhanghou.css">
	<script src="__PUBLIC__/Mobile/js/jquery-1.9.1.js"></script>
	<script src="__PUBLIC__/Mobile/js/97zzw.js"></script>
	<script src="__PUBLIC__/Mobile/js/jquery.flexslider-min.js"></script>
	<script src="__PUBLIC__/Common/Layer/layer.js"></script>
	<script>

function lvyou_xieyi(){	
	layer.open({
	  type: 2,
	  closeBtn: 0,
	  title: '旅游协议',
	  shadeClose: false,
	  shade: 0.3,
	  area: ['90%', '500px'],
	  content: '{:U("Mobile/Tourism/lvyou_xieyi")}' //iframe的url
	});
};
</script>
</head>

<body>
<section>
<!--商品-->
<div class="return">
	<span class="public">
		<a href="{:U('Tourism/tourism_tourism')}?id={$resone.id}" class="hover" style="font-size:18px;">商品</a>
		<a href="{:U('Tourism/tourism_detail')}?id={$resone.id}" style="font-size:18px;">详情</a>
		<a href="{:U('Tourism/tourism_evaluate')}?id={$resone.id}" style="font-size:18px;">评价</a>
	</span>
</div>


<form method="post" action="{:U('Tourism/tourism_count')}" onsubmit="return check_form();">
	<div class="commodity1">
	  <if condition="$pic neq '' ">
		  <div class="slide mySide" id="myCarousel">
			<div id="home_slider" class="carousel-inner">
				<ul class="slides">
					<volist name="pic" id="vv">
						<li><div class="slide"><img src="__PUBLIC__/Uploads/goods/{$vv}" style="width:100%; height:13em;"></div></li>
							<!-- <img src="__PUBLIC__/Uploads/goods/{$vv}" style="width:100%; height:20em;" > -->
					</volist>
				</ul>
			</div>
		 </div>
	  <else />
			<img src="__PUBLIC__/Uploads/goods/{$resone.pic_url}" >
	  </if>
	  <p style="margin-bottom:3%; padding:0 3%" class="size18 ">{$resone.title}</p>
	   <input type="hidden" name="goods_title" id="goods_title" value="{$resone.title}">
	  <input type="hidden" name="goods_id" id="goods_id" value="{$resone.id}">
	  <input type="hidden" name="goods_pic" id="goods_pic" value="{$resone.pic_url}">

	  <input type="hidden" name="chufa_price" id="chufa_price" value="0">
	  <input type="hidden" name="chufa_price_et" id="chufa_price_et" value="0">

	  <input type="hidden" name="goods_type" id="goods_type" value="1">
	  <input type="hidden" name="price_new" id="price_new" value="{$resone.price_new}" />
	  <input type="hidden" name="fanli_jifen" id="fanli_jifen" value="{$resone.fanli_jifen}" />
	  <input type="hidden" name="chufa_address" id="chufa_address" value="{$resone.chufa_address}" />
	  <input type="hidden" name="type" id="type" value="1" />


	<p style="padding:0 3%"><span class="Orange size18">￥</span>
	<span class="Orange size28 " id="taocan_price">{$resone.price_new}

	</span>

	<span class="Orange size18">元</span> <del class="gray">￥{$resone.price_old}元</del><br/>
	<a href="tel://021-52218886">
		<img style="height:30px; width:30px; " src="__PUBLIC__/Mobile/images/TEL3.png"> [ 021-52218886 ]  客服时间:[ 9:30 - 18:00 ]
	</a>
	</p>
	</div>

<div class="Evaluation" style="font-size:16px; color:#FF790C;">
送（ {$resone.fanli_jifen} 积分）   <if condition="empty($result_sc)"><button type="button" onClick="shoucang({$resone.id});" style="float:right; color:#333; padding:0 15px;">收藏此商品</button><else/><button type="button" style="float:right; color:#333; padding:0 15px;">已收藏</button></if>
</div>

<script type="text/javascript">
function shoucang(id){
	window.location.href="{:U('Index/shoucang')}?goods_id="+id+"&pic_url={$resone.pic_url}&price_old={$resone.price_old}&detail_title={$resone.title}&price_new={$resone.price_new}";
}
</script>

	<div class="Evaluation" style="font-size:16px;">&nbsp;&nbsp;
<input type="checkbox" name="lvyou_xieyi" style="position:relative; top:-4px;" id="lvyou_xieyi" checked="checked" value="1" onclick="xieyi();"> 同意 <a style="color:#F00;" href="{:U('Tourism/lvyou_xieyi')}">[ 旅游协议 ]</a>
	</div>

	<div class="Evaluation" style="font-size:16px;">
出发日期 :&nbsp;
<select name="chufa_date" id="chufa_date" onchange="changeForm(this.value)" style="height:30px;">
	<option value="">----- 请选择出发日期 -----</option>
	<foreach name="chufa_taocan" item="vo_chufa">
		<option value="{$vo_chufa.chufa_date}">----- {$vo_chufa.chufa_date} -----</option>
	</foreach>
</select>


	<foreach name="chufa_taocan" item="vo_chufa_2">
		<input type="hidden" id="aa_{$vo_chufa_2.chufa_date}" value="{$vo_chufa_2.chufa_price}" />
		<input type="hidden" id="bb_{$vo_chufa_2.chufa_date}" value="{$vo_chufa_2.chufa_price_et}" />
	</foreach>

<script type="text/javascript">

function changeForm(date){

	var chufa_price = $('#aa_'+date).val();
	var chufa_price_et = $('#bb_'+date).val();

	$('#chufa_price').val(chufa_price);
	$('#chufa_price_et').val(chufa_price_et);

	$('#chufa_price_span').html(chufa_price);	//成人价

	$('#chufa_price_et_span').html(chufa_price_et);		//儿童价
	

	$('#taocan_price').html(chufa_price);	//价格显示

}
</script>

<br/><br/>
        成人：<a href="javascript:;" onclick="jian_nub()" style="border:1px solid #ccc;padding:5px 20px;">-</a>
                  <input name="goods_num" type="text" value="1" style=" border:1px solid #CCC; width:60px; position: relative; top:-2px; text-align: center; font-weight:600; height:29px; font-size: 18px; border-radius:0;">
              <a href="javascript:;" onclick="jia_nub()" style="border:1px solid #CCC;padding:5px 20px;">+</a>
              <span style="color:#F00; font-size:18px;" id="chufa_price_span">{$resone.price_new}</span> 元/人(单价)
        <br/><br/>
        儿童：<a href="javascript:;" onclick="jian_nub_et()" style="border:1px solid #ccc;padding:5px 20px;">-</a>
                  <input name="goods_num_et" type="text" value="0" style=" border:1px solid #CCC; width:60px; position: relative; top:-2px; text-align: center; font-weight:600; height:29px; font-size: 18px; border-radius:0;">
              <a href="javascript:;" onclick="jia_nub_et()" style="border:1px solid #CCC;padding:5px 20px;">+</a>

              <span style="color:#F00; font-size:18px;" id="chufa_price_et_span">0</span> 元/人(单价)
	</div>


	<div class="Evaluation" style="font-size:16px;">
出发城市: {$resone.chufa_address}
	</div>
	<div style="height:50px;"></div>	
<div class="Navigation" style="position:fixed; bottom:0; width:100%;">
	<button type="button" class="Pay" onclick="return_home()" style="width:40%; height:40px; float:left; background:#FF790C; border: none; outline: none; border-right:1px solid #FFF; font-size:16px;">首页</button>
	<if condition="$res_member['grade_name'] == '合伙人' || $res_member['grade_name']=='会员'">

	  <switch name="resone['shangjia']" >
  <case value="1">
<button type="submit" id="yuding" class="Pay" style="width:60%; font-size:16px; float:left; background:#33BC60; border: none; outline: none">立即预订</button>
   </case>
	 <default />
	 <input type="button" class="Pay size18" style="width:60%; float:left; background:#666; border:none; height: 40px; line-height: 35px;  border-right: 1px solid #ffffff; font-size:16px;" value="此商品已下架">
  </switch>

<else/>
	<a href="{:U('Mycenter/become_hui')}"><span style="padding:9px 0; text-align: center; background:#666;color:#FFF; width:60%; display: block; float: left; font-size:16px;">请晋升为会员，继续购物</span></a>
	</if>

<script>
    //点击添加或者减少
   function jian_nub(){
        var goods_num = $('input[name="goods_num"]').val();
        goods_num = Number(goods_num) - 1;
        if(goods_num < 1){
        	alert('数量不能小于 1');
        	return false;
        }
        $('input[name="goods_num"]').val(goods_num);   
    }
	
    function jia_nub(){
        var goods_num = $('input[name="goods_num"]').val();
        goods_num = Number(goods_num) + 1;
        if(goods_num > 99){
        	alert('数量不能大于 99');
        	return false;
        }
        $('input[name="goods_num"]').val(goods_num);
    }

    //点击添加或者减少
   function jian_nub_et(){
        var goods_num_et = $('input[name="goods_num_et"]').val();
        goods_num_et = Number(goods_num_et) - 1;
        if(goods_num_et < 0){
        	alert('数量不能小于 0');
        	return false;
        }
        $('input[name="goods_num_et"]').val(goods_num_et);   
    }
	
    function jia_nub_et(){
    	var chufa_price_et = $('#chufa_price_et').val();
    	if(chufa_price_et == '' || chufa_price_et == 0){
    		alert('该日期儿童票不可用');
    		return false;
    	}

        var goods_num_et = $('input[name="goods_num_et"]').val();
        goods_num_et = Number(goods_num_et) + 1;
        if(goods_num_et > 99){
        	alert('数量不能大于 99');
        	return false;
        }
        $('input[name="goods_num_et"]').val(goods_num_et);
    }


</script>


	</div>
<script type="text/javascript">
function xieyi(){
	var lvyou_xieyi = $('#lvyou_xieyi').val();
	if(lvyou_xieyi == 0){
		$('#yuding').attr('type','submit');
		$('#yuding').css('background','#33BC60');
		$('#lvyou_xieyi').val(1);
	}else{
		$('#yuding').attr('type','button');
		$('#yuding').css('background','#CCC');
		$('#lvyou_xieyi').val(0);
	}	
}
</script>
<script type="text/javascript">
function check_form(){
	var chufa_date = $('#chufa_date').val();
	if(chufa_date == ''){
		alert('请选择出发日期');
		return false;
	}
	return true;
}
</script>

	<script type="text/javascript">
	function return_home(){
		window.location.href="{:U('Index/tourism_index')}";
	}	
	</script>
</div>

</section>

<script type="text/javascript">
	$(function () {
		$('#home_slider').flexslider({
			animation : 'slide',
			controlNav : true,
			directionNav : true,
			animationLoop : true,
			slideshow : false,
			useCSS : false
		});
		
		var pic = $('#goods_pic').val();
	    var gid = $('#goods_gid').val();
	    var price = $('#goods_price').val();
	    var name = $('#goods_title').val();
	    var type = $('#goods_type').val(); 
	    $.ajax({
	        type: "POST",
	        url: "{:U('Tourism/add_footprint')}",
	        data: "gid="+gid+"&goods_pic="+pic+"&goods_price="+price+"&goods_name="+name+"&type="+type,
	        success: function(msg){
	         	console.log(msg);
	         }
	    });
	});

</script> 
</body>
</html>
